Dynomotion

Group: DynoMotion Message: 9794 From: engnerdan Date: 7/15/2014
Subject: How to tell if a channel is enabled

Tom,

In the script commands there is one listed as "Enabled", but when I try to use it I get the following error from the compiler. 


tcc: undefined symbol 'ENABLED'



I am trying to use it to tell if the 3 axes on my mill are enabled, and if they are then I am setting a bit high which in turn energizes the "drive enable" line in on my servo drives. 

    if(Enabled(0)&&Enabled(1)&&Enabled(2))
    {
    SetBit(144); // Enables servo drives
    }
    else
    {
       clearbit(144); //UN-ENABLES THE DRIVES
     }



Did you remove this script command? How else can I do this? 



I know you spend a lot of time supporting your products and answering posts on here. But I have not seen many say it. So THANK YOU for your time, effort and great products. 


-Dan

Group: DynoMotion Message: 9795 From: Tom Kerekes Date: 7/15/2014
Subject: Re: How to tell if a channel is enabled
Hi Dan,

C Functions and Variables have a different syntax than script commands.  See the KMotionDef.h file for C definitions. 

The Enable state for an axis is a member variable of the axis channel structure.  So it can be tested like this:

        // if all axes channels are enabled then enable the amps
        if (ch0->Enable && ch1->Enable && ch2->Enable)
            SetBit(144);
        else
            ClearBit(144);

Regards
TK


From: "engnerdan@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Tuesday, July 15, 2014 9:12 PM
Subject: [DynoMotion] How to tell if a channel is enabled

 
Tom,
In the script commands there is one listed as "Enabled", but when I try to use it I get the following error from the compiler. 

tcc: undefined symbol 'ENABLED'


I am trying to use it to tell if the 3 axes on my mill are enabled, and if they are then I am setting a bit high which in turn energizes the "drive enable" line in on my servo drives. 

    if(Enabled(0)&&Enabled(1)&&Enabled(2))
    {
    SetBit(144); // Enables servo drives
    }
    else
    {
       clearbit(144); //UN-ENABLES THE DRIVES
     }


Did you remove this script command? How else can I do this? 


I know you spend a lot of time supporting your products and answering posts on here. But I have not seen many say it. So THANK YOU for your time, effort and great products. 

-Dan


Group: DynoMotion Message: 9796 From: daniel w Date: 7/15/2014
Subject: Re: How to tell if a channel is enabled
Thanks, that explains why it would not work. Turns out I have hardly a clue what I am doing with C programming. Well back to the books and more reading for me.

Thanks again,
Dan